﻿using System;
using UnityEngine;

// Token: 0x02000386 RID: 902
public class FPSDisplay : MonoBehaviour
{
	// Token: 0x06001798 RID: 6040 RVA: 0x00096144 File Offset: 0x00094344
	private void RefreshScreen()
	{
		this.w = Screen.width;
		this.h = Screen.height;
		this.style = new GUIStyle();
		this.rect = new Rect(0f, 0f, (float)this.w, (float)(this.h * 2 / 100));
		this.style.alignment = TextAnchor.UpperLeft;
		this.style.fontSize = this.h * 2 / 100;
		this.style.normal.textColor = new Color(0f, 0f, 0.5f, 1f);
	}

	// Token: 0x06001799 RID: 6041 RVA: 0x000961E5 File Offset: 0x000943E5
	private void Start()
	{
		this.RefreshScreen();
	}

	// Token: 0x0600179A RID: 6042 RVA: 0x000961F0 File Offset: 0x000943F0
	private void Update()
	{
		this.deltaTime += (Time.deltaTime - this.deltaTime) * 0.1f;
		float num = this.deltaTime * 1000f;
		float num2 = 1f / this.deltaTime;
		this.text = string.Format(this.cFormat, num, num2);
	}

	// Token: 0x0600179B RID: 6043 RVA: 0x00096253 File Offset: 0x00094453
	private void OnGUI()
	{
		GUI.Label(this.rect, this.text, this.style);
	}

	// Token: 0x040019DE RID: 6622
	private float deltaTime;

	// Token: 0x040019DF RID: 6623
	private string cFormat = "{0:0.0} ms ({1:0.} fps)";

	// Token: 0x040019E0 RID: 6624
	private int w;

	// Token: 0x040019E1 RID: 6625
	private int h;

	// Token: 0x040019E2 RID: 6626
	private Rect rect;

	// Token: 0x040019E3 RID: 6627
	private GUIStyle style;

	// Token: 0x040019E4 RID: 6628
	private string text;
}
